package com.example.smssender;

import java.io.Serializable;

/**
 * 失败联系人详情数据模型
 */
public class FailedContact implements Serializable {
    private String phoneNumber;      // 手机号
    private String contactName;      // 联系人姓名
    private String errorMessage;     // 失败原因
    private int resultCode;          // 错误码（如果有）

    public FailedContact() {
    }

    public FailedContact(String phoneNumber, String contactName, String errorMessage) {
        this.phoneNumber = phoneNumber;
        this.contactName = contactName;
        this.errorMessage = errorMessage;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public String getContactName() {
        return contactName;
    }

    public void setContactName(String contactName) {
        this.contactName = contactName;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }

    public int getResultCode() {
        return resultCode;
    }

    public void setResultCode(int resultCode) {
        this.resultCode = resultCode;
    }

    /**
     * 获取显示名称（优先显示联系人姓名，否则显示手机号）
     */
    public String getDisplayName() {
        if (contactName != null && !contactName.trim().isEmpty()) {
            return contactName;
        }
        return phoneNumber != null ? phoneNumber : "未知";
    }
}

